#include <iostream>
#include <cstring>
#include <cstdlib>
//charles_ling no love cash only
void func()
{
    
}
using namespace std;
class Student
{
private:

    int num;
    char* name;
    double score;
    //const int n;

public:
    static string teacher;//���ڶ���  �����˹���
    explicit Student()
    {
        cout << "student()" << endl;
        num = 100;
        name = new char;
        strcpy(name," ");
        score = 98.5;

    }
    Student(int num,char *na,double score):num(num),score(score)
    {
        cout << "student(int,string,double)" << endl;
        name = new char[strlen(na)+1];
        strcpy(name,na);
        //num = num;
    }
    Student(const Student &s)
    {
        cout << "student(const student &)" << endl;
        num = s.num;
        name = new char[strlen(s.name)+1];
        strcpy(name,s.name);
        score = s.score;
    }
    void showdata()
    {
        cout << num << " " << name << " " << score <<  endl;
    }

    static void ShowTeacher()
    {
        cout << "teacher is " << teacher << endl;
    }

    ~Student ()
    {
        cout << "~student () name " << name << endl;
        if(name != nullptr)
        {
            delete [] name;
            name = nullptr;
        }
    }
};
string Student::teacher = "������ʦ";//���ⶨ�� �����˹���
int main()
{
    Student s1;
    cout << s1.teacher << endl;

    s1.ShowTeacher();

    s1.teacher = "����ʦ"; // �ı�Ψһ������
    Student s2;
    cout << s2.teacher << endl;
    cout << s2.teacher << endl;

    Student::ShowTeacher();

    cout << Student::teacher << endl;

    return 0;
}
